﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Things.Web.SaleSet
{
    public partial class SaleSetList : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                _ctlHideGoodsId.Value = Request.QueryString["GoodsId"];
                Things.OrderPlan.SaleSetRepository repository = new OrderPlan.SaleSetRepository();
                gridView.DataSource = repository.FindAll(new Guid(Request.QueryString["GoodsId"]));
                gridView.DataBind();
            }
        }

        protected void _ctlBtnAdd_Click(object sender, EventArgs e)
        {
            Response.Redirect("./AddSaleSet.aspx?type=A&GoodsId=" + _ctlHideGoodsId.Value);
        }

        protected void _ctlBtnAddB_Click(object sender, EventArgs e)
        {
            Response.Redirect("./AddSaleSet.aspx?type=B&GoodsId=" + _ctlHideGoodsId.Value);
        }

        protected void _ctlBtnAddC_Click(object sender, EventArgs e)
        {
            Response.Redirect("./AddSaleSet.aspx?type=C&GoodsId=" + _ctlHideGoodsId.Value);
        }

        protected void _ctlBtnAddFree_Click(object sender, EventArgs e)
        {
            Response.Redirect("./SetParameter.aspx?GoodsId=" + _ctlHideGoodsId.Value);
        }
    }
}